﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>设置信息·基础资料</title>
    <meta name="keywords" content="设置信息|展业海报">
    <meta name="description" content="设置信息|展业海报">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="设置信息|展业海报">
    <meta name="msapplication-TileColor" content="#0e90d2">
    <style>
        #swiperBanner .swiper-pagination-bullet {
            width: 6px;
            height: 6px;
            display: inline-block;
            border-radius: 100%;
        }
    </style>

    <link rel="stylesheet" href="{D_PATH}static/css/reset_1.css">
    <link rel="stylesheet" href="{D_PATH}static/css/style_1.css">
    <script src="{D_PATH}static/js/rem_1.js"></script>

    {php echo register_jssdk();}
</head>
<style>
    .loan-box .arrow-tub {
        float: right;
        color: #424242;
        width: .2rem;
        height: .2rem;
        border: 2px solid #ccc;
        border-top-width: 0;
        border-right-width: 0;
        transform: translateY(-50%) rotate(-135deg);
        position: relative;
        top: .2rem;
        /* margin-top: .18rem; */

    }
    .input-color{
        font-size: .3rem;
    }
    .header-box {
        /*position: fixed;*/
        height: 42px;
        background: #fff;
        z-index: 9999;
        width: 94%;
        padding-left: 3%;
        padding-right: 3%;
        margin-bottom: .2rem;
    }
    .header-left {
        position: absolute;
        left: 3%;
        top: 9px;
        width: 24px;
        height: 24px;
        background: url("{D_PATH}static/images/back_icon.png") no-repeat center center;
        background-size: 10.5px 19px;
    }
    .header-title {
        line-height: 42px;
        font-size: 18px;
        color: #424242;
        text-align: center;
    }
    .header-right {
        position: absolute;
        right: 3%;
        top: 9px;
        line-height: 24px;
        font-size: 15px;
        color: #ed662c;
    }
</style>
<body>
<div class="header-box inner-box">
    <a href="javascript:history.go(-1);"><div class="header-left"></div></a>
    <div class="header-title">设置</div>
    <div class="header-right submit-btn">完成</div>
</div>
<div class="loan-box loan-box2">
    <div class="personData">
        <form onsubmit="return false;" class="bind-form-box">
            <div class="msg_group">
                <p class="p1">个人资料<span class="msg_must">(必填)</span>
                    <a href="javascript:" class="perfected"></a>            </p>
            </div>
            <div class="headimg_group">
                <a onclick="onChooseImageClick('parameter-avatar')" href="javascript:;"  class="center-cell avatar-cell center-cell-gap inner-box">
                    <p class="head_img_text">头像</p>
                    <img src="{if $re['info']['avatar']}{$_W['attachurl']}{$re['info']['avatar']}{else}{D_PATH}static/picture/avatar_icon_1.png{/if}" id="parameter-avatar">
                    <a href="javascript:" class="arrow-tub arrow_align"></a>
                </a>
            </div>
            <div class="input-group">
                <input type="text" placeholder="请输入姓名" value="{$re['info']['username']}" name="username" class="input-color">
            </div>
            <div class="input-group">
                <input type="text" placeholder="请输入电话" value="{$re['info']['phone']}" name="phone" class="input-color">
            </div>
            <input type="hidden" value="1" name="pn">
            <input type="hidden" value="{$re['info']['avatar']}" name="avatar">
        </form>
    </div>
<!--
    <div class="data_msg">
        <a href="/qutu/user/set_detailed/pn/1/recommend_id/666666" class="item-wrap">
            <p class="p1"><span><img src="{D_PATH}static/picture/add.jpg"></span>&nbsp;详细资料<span>(建议完善)</span><span class="perfected">待完善</span></p><p class="p2">增加该信息可使生成的海报等包含详细资料</p>
        </a>
    </div>

    <div class="data_msg">
        <a href="/qutu/user/set_resume/pn/1/recommend_id/666666" class="item-wrap">
            <p class="p1">
                <span><img src="{D_PATH}static/picture/add.jpg"></span>&nbsp;简历资料<span>(建议完善)</span><span class="perfected">待完善</span></p>
            <p class="p2">增加该信息可使生成的海报等包含简历基础资料</p>
        </a>
    </div>
-->
</div>
<script src="{D_PATH}static/js/jquery-1.11.2.min_2.js"></script>

<script>
    $(function(){
        $('.submit-btn').off().on('click', function(){
            var  data=$('form').serialize();
            $.ajax({
                url: "{php echo $this->createMobileUrl('person',array('op'=>'savezl'));}",
                type: 'POST',
                data:data,
                success: function(res){
//                    var res=JSON.parse(res);
                    if(res.status==1) {
                        alert(res.message);
                    }else {

                        if (window.confirm(res.message+"！,OK前往VIP页面，Cancel返回上一页")) {
                            location.href="";
                            return true;
                        } else {
                            history.go(-1);
                            return false;
                        }
                    }
                }
            })
        });

        $('.bind-item-del').off().on('click', function(){
            $(this).prev().val('');
        });


    });

    function onChooseImageClick(id) {
        wx.chooseImage({
            count: 1,
            success: function (res) {
                var localId = res.localIds[0];
                $('#' + id).attr('src', localId);

                if (localId.indexOf("wxlocalresource") != -1) {
                    localId = localId.replace("wxlocalresource", "wxLocalResource");
                }

                wx.uploadImage({
                    localId: localId,
                    success: function (res) {
                        $.post("{php echo $this->createMobileUrl('index',array('op'=>'upload2'));}", {
                            avatar:res.serverId
                           },

                            function (res) {
                                $('input[name=avatar]').val(res.file);

                            }, 'json');




                    },
                    fail: function (res) {
                        alert('上传失败，请重新上传！');
                    }

                });
            }
        });
    }
</script>


</body>
</html>